package com.fowo.api.mp.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

@Data
public class WxResult {

    /**
     * 错误码
     */
    @JsonProperty("errcde")
    private Integer errCode;

    /**
     * 错误信息
     */
    @JsonProperty("errmsg")
    private String errMsg;

    public void throwIfErrCode() throws Exception {
        if (errCode != null && errCode != 0) {
            throw new Exception(errMsg);
        }
    }
}
